namespace SimpleWebServices.Models
{
    using System.Diagnostics.CodeAnalysis;
    using System.Xml.Serialization;

    [XmlRoot("contact")]
    public sealed class Contact
    {
        public Contact()
        {
            this.Addresses = new InternationalAddressCollection();
            this.Emails = new EmailCollection();
            this.Telephones = new TelephoneCollection();
        }

        [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly", Justification = "Can't deserialize if the setter is private.")]
        [XmlElement("addresses")]
        public InternationalAddressCollection Addresses
        {
            get;
            set;
        }

        [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly", Justification = "Can't deserialize if the setter is private.")]
        [XmlElement("emails")]
        public EmailCollection Emails
        {
            get;
            set;
        }

        [XmlAttribute("key")]
        public string Key
        {
            get;
            set;
        }

        [XmlElement("name")]
        public PersonalName Name
        {
            get;
            set;
        }

        [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly", Justification = "Can't deserialize if the setter is private.")]
        [XmlElement("telephones")]
        public TelephoneCollection Telephones
        {
            get;
            set;
        }
    }
}